home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE04 / TAPPLIC / LISTING6.PAS next >
Encoding:
Pascal/Delphi Source File  |  1995-09-26  |  729 b   |  39 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     procedure FormCreate(Sender: TObject);
  12.   private
  13.     { Private declarations }
  14.     procedure AppMinimize(Sender: TObject);
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TForm1.FormCreate(Sender: TObject);
  27. begin
  28.   Application.OnMinimize := AppMinimize;
  29. end;
  30.  
  31. procedure TForm1.AppMinimize(Sender: TObject);
  32. begin
  33.   if FormStyle = fsStayOnTop then
  34.     SetWindowPos(Application.Handle, HWnd_TopMost, 0, 0, 0, 0,
  35.                  SWP_NoActivate or SWP_NoSize or SWP_NoMove);
  36. end;
  37.  
  38. end.
  39.